package com.markedquilt.dao;
/*
 * PackageName: com.markedquilt.dao
 * ClassName:   ArticleDao
 * Author:   zhang
 * Date:     Created in 2020/11/2
 * Description:
 * History:
 * <author>        <time>             <version>          <desc>
 * 作者姓名         修改时间            版本号              描述
 * zhang           2020/11/2      1.0
 */

import com.markedquilt.pojo.Article;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Title:
 * Project: springbootTask
 *
 * @author ZhangKe
 * Created on 2020/11/2
 */
public interface ArticleDao {

    @Select("SELECT * FROM t_article where id = #{id}")
    public Article findById(Integer id);

    @Select("SELECT COUNT(DISTINCT id) FROM t_article")
    public Integer countArticle();

    @Select("SELECT * FROM t_article")
    public List<Article> findAll();

    @Select("SELECT * FROM t_article limit #{page},#{rows}")
    public List<Article> findPagedAll(int page,int rows);

}
